<?php 
require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'../DAO/PagecategoryDAO.php';
class PagecategoryService
{
	public function create(BaseContext $context, ServiceResult $result, PagecategoryDomain $pagecategoryDomain)
	{
		try
		{
			$pagecategoryDAO = new PagecategoryDAO($context);
			$pagecategoryDAO->create($pagecategoryDomain);
			$result->setSuccess();
		}
		catch (Exception $e)
		{
			$context->logException($e);
			$result->setException($e);
		}
	}

	public function update(BaseContext $context, ServiceResult $result, PagecategoryDomain $pagecategoryDomain)
	{
		try
		{
			$pagecategoryDAO = new PagecategoryDAO($context);
			$pagecategoryDAO->update($pagecategoryDomain);
			$result->setSuccess();
		}
		catch (Exception $e)
		{
			$context->logException($e);
			$result->setException($e);
		}
	}

	public function delete(BaseContext $context, ServiceResult $result, $oid)
	{
		try
		{
			$pagecategoryDAO = new PagecategoryDAO($context);
			$pagecategoryDAO->delete($oid);
			$result->setSuccess();
		}
		catch (Exception $e)
		{
			$context->logException($e);
			$result->setException($e);
		}
	}

	public function findByOid(BaseContext $context, ServiceResult $result, $oid)
	{
		try
		{
			$pagecategoryDAO = new PagecategoryDAO($context);
			$pagecategoryDomain = $pagecategoryDAO->findByOid($oid);
			$result->setSuccess();
			return $pagecategoryDomain;
		}
		catch (Exception $e)
		{
			$context->logException($e);
			$result->setException($e);
		}
	}

	public function findAll(BaseContext $context, ServiceResult $result)
	{
		try
		{
			$pagecategoryDAO = new PagecategoryDAO($context);
			$pagecategoryDomainArr = $pagecategoryDAO->findAll();
			$result->setSuccess();
			return $pagecategoryDomainArr;
		}
		catch (Exception $e)
		{
			$context->logException($e);
			$result->setException($e);
		}
	}

}
?>